﻿<UserControl x:Class="SLExtensions.Showcase.PageViewbox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controllers="clr-namespace:SLExtensions.Showcase.Controllers"
    xmlns:slec="clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"
    MinWidth="400" MinHeight="300">
    <UserControl.Resources>
        <controllers:PageViewboxController x:Key="controller"/>
    </UserControl.Resources>
    <StackPanel x:Name="LayoutRoot" Background="White">
        <ListBox x:Name="stretch" ItemsSource="{Binding StrechValues, Source={StaticResource controller}}" 
                 SelectedItem="{Binding SelectedStretchValue, Mode=TwoWay, Source={StaticResource controller}}">
            
        </ListBox>
        <Border BorderBrush="Orange" BorderThickness="1" VerticalAlignment="Center" HorizontalAlignment="Center">
            <slec:Viewbox Stretch="{Binding SelectedStretchValue, Source={StaticResource controller}}" Width="300" Height="200" >
                <Canvas Height="50" Width="50" >
                    <Path x:Name="path3254" Opacity="0.40909089" Data="M45.078058,39.161163A19.622213,6.1871843,0,1,1,5.8336315,39.161163A19.622213,6.1871843,0,1,1,45.078058,39.161163z" Canvas.Top="2.475">
                        <Path.Fill>
                            <RadialGradientBrush Center="25.455845,39.161163" RadiusX="19.622213" RadiusY="19.622213" GradientOrigin="25.455845,39.161163" MappingMode="Absolute">
                                <RadialGradientBrush.Transform>
                                    <MatrixTransform Matrix="1,0,0,0.315315,0,26.81305"/>
                                </RadialGradientBrush.Transform>
                                <GradientStop Color="#FF000000" Offset="0" />
                                <GradientStop Color="#00000000" Offset="1" />
                            </RadialGradientBrush>
                        </Path.Fill>
                    </Path>
                    <Path Stroke="#FF808080" StrokeMiterLimit="4" x:Name="path3243" Data="F1 M23.25,0.46875 C22.784561,0.50059628 22.332166,0.57268469 21.875,0.625 L21.84375,0.625 20.75,6.59375 C18.967275,6.9997399 17.290091,7.6887415 15.78125,8.625 L10.875,5.09375 C9.5487118,6.1234406 8.3418016,7.3243453 7.28125,8.625 L10.6875,13.59375 C9.6532671,15.174265 8.8755317,16.978974 8.4375,18.875 8.437425,18.883963 8.4374391,18.904688 8.4375,18.90625 L2.5,19.84375 C2.3914467,20.730383 2.34375,21.646689 2.34375,22.5625 2.3437501,23.3118 2.3644394,24.051089 2.4375,24.78125 L8.375,25.84375 C8.797279,27.905642 9.5994587,29.831262 10.71875,31.53125 L7.1875,36.375 C8.1988261,37.630518 9.3663917,38.773616 10.625,39.78125 L15.625,36.34375 C17.372433,37.458467 19.323083,38.240124 21.4375,38.625 L22.375,44.53125 C23.041183,44.591889 23.724349,44.59375 24.40625,44.59375 25.368935,44.593749 26.288487,44.557267 27.21875,44.4375 L28.34375,38.40625 C30.351311,37.906649 32.237219,37.03996 33.875,35.875 L38.6875,39.375 C39.935528,38.313203 41.076777,37.092744 42.0625,35.78125 L38.5625,30.71875 C39.510353,29.08176 40.167129,27.275609 40.5,25.34375 L46.40625,24.40625 C46.458044,23.789904 46.46875,23.192163 46.46875,22.5625 46.46875,21.468286 46.341568,20.395416 46.1875,19.34375 L40.1875,18.25 C39.717306,16.513776 38.945824,14.893898 37.96875,13.4375 L41.5,8.59375 C40.405427,7.2551429 39.156822,6.0185688 37.78125,4.96875 L32.6875,8.46875 C31.223504,7.6029126 29.648037,6.9385679 27.9375,6.5625 L27,0.625 C26.146701,0.52462461 25.286379,0.46875 24.40625,0.46875 24.168378,0.46875001 23.923566,0.4612654 23.6875,0.46875 23.572417,0.47239881 23.458534,0.4620551 23.34375,0.46875 23.312662,0.4705632 23.281029,0.46662691 23.25,0.46875 z M24.0625,15.65625 C24.176666,15.650457 24.290652,15.65625 24.40625,15.65625 28.105377,15.65625 31.125,18.675874 31.125,22.375 31.125001,26.074126 28.105376,29.0625 24.40625,29.0625 20.707125,29.062501 17.71875,26.074126 17.71875,22.375 17.718751,18.791473 20.52335,15.835842 24.0625,15.65625 z" Canvas.Left="0.884">
                        <Path.Fill>
                            <LinearGradientBrush StartPoint="14.462892,12.284524" EndPoint="34.534348,39.684914" ColorInterpolationMode="ScRgbLinearInterpolation" MappingMode="Absolute" SpreadMethod="Pad">
                                <LinearGradientBrush.Transform>
                                    <MatrixTransform Matrix="1.241935,0,0,1.241935,-5.027508,-7.208988"/>
                                </LinearGradientBrush.Transform>
                                <GradientStop Color="#FFFF8B00" Offset="0" />
                                <GradientStop Color="#FFF8F8F8" Offset="0.25" />
                                <GradientStop Color="#FFFFE5C6" Offset="0.5" />
                                <GradientStop Color="#FFE57D00" Offset="0.75" />
                                <GradientStop Color="#F0FF8B00" Offset="1" />
                            </LinearGradientBrush>
                        </Path.Fill>
                    </Path>
                    <Path Stroke="#A5FFFFFF" StrokeThickness="1.64875567" StrokeMiterLimit="4" x:Name="path3283" 
				Opacity="0.64772728" Data="M36.239223,23.781593A12.727922,12.727922,0,1,1,10.783379,23.781593A12.727922,12.727922,0,1,1,36.239223,23.781593z" Canvas.Left="11.034" Canvas.Top="7.937">
                        <Path.RenderTransform>
                            <MatrixTransform Matrix="0.606518,0,0,0.606518,0,0"/>
                        </Path.RenderTransform>
                    </Path>
                    <Path Stroke="#58FFFFFF" StrokeThickness="0.9999997" StrokeMiterLimit="4" x:Name="path3285" Opacity="0.34659089" Data="M22.557788,1.6501132L21.679599,7.4291233C20.008601,7.8096689,16.934874,8.9735344,15.520595,9.8511162L10.848562,6.3639293C9.6053938,7.3290873,9.5201391,7.3945394,8.5260544,8.6136804L11.904107,13.623634C10.934692,15.105095 9.7703031,17.745129 9.3522336,19.631722 9.3522336,19.631722 3.4328248,20.629563 3.4328248,20.629563 3.3310749,21.460629 3.3799751,23.239361 3.4484569,23.923761L9.1027005,24.942349C9.4985145,26.875018,10.979731,29.985937,12.028874,31.579383L8.4532981,36.303427C9.4012426,37.480259,9.5909623,37.587948,10.770691,38.532432L15.551859,35.029612C17.189777,36.074467,20.440892,37.345498,22.422794,37.706253L23.207481,43.412507C23.831913,43.469346,25.556962,43.628788,26.428924,43.516527L27.307112,37.576373C29.188855,37.108084,32.440272,35.773413,33.97541,34.681463L38.751465,38.132271C39.921276,37.13702,39.931757,36.987055,40.855703,35.757755L37.316505,30.727054C38.204954,29.192656,39.353733,26.191831,39.665742,24.381045L45.460384,23.419582C45.508931,22.841863,45.511294,21.230793,45.366882,20.245037L39.463105,19.226449C39.022378,17.599038,37.509894,14.666467,36.594056,13.301345L40.346408,8.5773019C39.320436,7.3225876,38.938964,7.150431,37.649602,6.1664065L32.707289,9.7056032C31.335043,8.8940304,28.598675,7.6568558,26.995341,7.3043568L26.122266,1.6501132C25.322445,1.5560285,23.014871,1.5978075,22.557788,1.6501132z" Canvas.Left="0.884"/>
                </Canvas>
            </slec:Viewbox>
            
        </Border>

        <ContentControl>
            <ContentControl.Content>
                <Canvas Height="50" Width="50" >
                    <Path  Opacity="0.40909089" Data="M45.078058,39.161163A19.622213,6.1871843,0,1,1,5.8336315,39.161163A19.622213,6.1871843,0,1,1,45.078058,39.161163z" Canvas.Top="2.475">
                        <Path.Fill>
                            <RadialGradientBrush Center="25.455845,39.161163" RadiusX="19.622213" RadiusY="19.622213" GradientOrigin="25.455845,39.161163" MappingMode="Absolute">
                                <RadialGradientBrush.Transform>
                                    <MatrixTransform Matrix="1,0,0,0.315315,0,26.81305"/>
                                </RadialGradientBrush.Transform>
                                <GradientStop Color="#FF000000" Offset="0" />
                                <GradientStop Color="#00000000" Offset="1" />
                            </RadialGradientBrush>
                        </Path.Fill>
                    </Path>
                    <Path Stroke="#FF808080" StrokeMiterLimit="4" Data="F1 M23.25,0.46875 C22.784561,0.50059628 22.332166,0.57268469 21.875,0.625 L21.84375,0.625 20.75,6.59375 C18.967275,6.9997399 17.290091,7.6887415 15.78125,8.625 L10.875,5.09375 C9.5487118,6.1234406 8.3418016,7.3243453 7.28125,8.625 L10.6875,13.59375 C9.6532671,15.174265 8.8755317,16.978974 8.4375,18.875 8.437425,18.883963 8.4374391,18.904688 8.4375,18.90625 L2.5,19.84375 C2.3914467,20.730383 2.34375,21.646689 2.34375,22.5625 2.3437501,23.3118 2.3644394,24.051089 2.4375,24.78125 L8.375,25.84375 C8.797279,27.905642 9.5994587,29.831262 10.71875,31.53125 L7.1875,36.375 C8.1988261,37.630518 9.3663917,38.773616 10.625,39.78125 L15.625,36.34375 C17.372433,37.458467 19.323083,38.240124 21.4375,38.625 L22.375,44.53125 C23.041183,44.591889 23.724349,44.59375 24.40625,44.59375 25.368935,44.593749 26.288487,44.557267 27.21875,44.4375 L28.34375,38.40625 C30.351311,37.906649 32.237219,37.03996 33.875,35.875 L38.6875,39.375 C39.935528,38.313203 41.076777,37.092744 42.0625,35.78125 L38.5625,30.71875 C39.510353,29.08176 40.167129,27.275609 40.5,25.34375 L46.40625,24.40625 C46.458044,23.789904 46.46875,23.192163 46.46875,22.5625 46.46875,21.468286 46.341568,20.395416 46.1875,19.34375 L40.1875,18.25 C39.717306,16.513776 38.945824,14.893898 37.96875,13.4375 L41.5,8.59375 C40.405427,7.2551429 39.156822,6.0185688 37.78125,4.96875 L32.6875,8.46875 C31.223504,7.6029126 29.648037,6.9385679 27.9375,6.5625 L27,0.625 C26.146701,0.52462461 25.286379,0.46875 24.40625,0.46875 24.168378,0.46875001 23.923566,0.4612654 23.6875,0.46875 23.572417,0.47239881 23.458534,0.4620551 23.34375,0.46875 23.312662,0.4705632 23.281029,0.46662691 23.25,0.46875 z M24.0625,15.65625 C24.176666,15.650457 24.290652,15.65625 24.40625,15.65625 28.105377,15.65625 31.125,18.675874 31.125,22.375 31.125001,26.074126 28.105376,29.0625 24.40625,29.0625 20.707125,29.062501 17.71875,26.074126 17.71875,22.375 17.718751,18.791473 20.52335,15.835842 24.0625,15.65625 z" Canvas.Left="0.884">
                        <Path.Fill>
                            <LinearGradientBrush StartPoint="14.462892,12.284524" EndPoint="34.534348,39.684914" ColorInterpolationMode="ScRgbLinearInterpolation" MappingMode="Absolute" SpreadMethod="Pad">
                                <LinearGradientBrush.Transform>
                                    <MatrixTransform Matrix="1.241935,0,0,1.241935,-5.027508,-7.208988"/>
                                </LinearGradientBrush.Transform>
                                <GradientStop Color="#FFFF8B00" Offset="0" />
                                <GradientStop Color="#FFF8F8F8" Offset="0.25" />
                                <GradientStop Color="#FFFFE5C6" Offset="0.5" />
                                <GradientStop Color="#FFE57D00" Offset="0.75" />
                                <GradientStop Color="#F0FF8B00" Offset="1" />
                            </LinearGradientBrush>
                        </Path.Fill>
                    </Path>
                    <Path Stroke="#A5FFFFFF" StrokeThickness="1.64875567" StrokeMiterLimit="4" 
				Opacity="0.64772728" Data="M36.239223,23.781593A12.727922,12.727922,0,1,1,10.783379,23.781593A12.727922,12.727922,0,1,1,36.239223,23.781593z" Canvas.Left="11.034" Canvas.Top="7.937">
                        <Path.RenderTransform>
                            <MatrixTransform Matrix="0.606518,0,0,0.606518,0,0"/>
                        </Path.RenderTransform>
                    </Path>
                    <Path Stroke="#58FFFFFF" StrokeThickness="0.9999997" StrokeMiterLimit="4" Opacity="0.34659089" Data="M22.557788,1.6501132L21.679599,7.4291233C20.008601,7.8096689,16.934874,8.9735344,15.520595,9.8511162L10.848562,6.3639293C9.6053938,7.3290873,9.5201391,7.3945394,8.5260544,8.6136804L11.904107,13.623634C10.934692,15.105095 9.7703031,17.745129 9.3522336,19.631722 9.3522336,19.631722 3.4328248,20.629563 3.4328248,20.629563 3.3310749,21.460629 3.3799751,23.239361 3.4484569,23.923761L9.1027005,24.942349C9.4985145,26.875018,10.979731,29.985937,12.028874,31.579383L8.4532981,36.303427C9.4012426,37.480259,9.5909623,37.587948,10.770691,38.532432L15.551859,35.029612C17.189777,36.074467,20.440892,37.345498,22.422794,37.706253L23.207481,43.412507C23.831913,43.469346,25.556962,43.628788,26.428924,43.516527L27.307112,37.576373C29.188855,37.108084,32.440272,35.773413,33.97541,34.681463L38.751465,38.132271C39.921276,37.13702,39.931757,36.987055,40.855703,35.757755L37.316505,30.727054C38.204954,29.192656,39.353733,26.191831,39.665742,24.381045L45.460384,23.419582C45.508931,22.841863,45.511294,21.230793,45.366882,20.245037L39.463105,19.226449C39.022378,17.599038,37.509894,14.666467,36.594056,13.301345L40.346408,8.5773019C39.320436,7.3225876,38.938964,7.150431,37.649602,6.1664065L32.707289,9.7056032C31.335043,8.8940304,28.598675,7.6568558,26.995341,7.3043568L26.122266,1.6501132C25.322445,1.5560285,23.014871,1.5978075,22.557788,1.6501132z" Canvas.Left="0.884"/>
                </Canvas>
            </ContentControl.Content>
        </ContentControl>
    </StackPanel>
</UserControl>
